home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS18.ADF
/
Progs
/
StarProbe
/
SPRPT.C
< prev
Wrap
Text File
|
1989-01-27
|
3KB
|
128 lines
/****************************************************************************
*** ***
*** S T A R P R O B E R E P O R T ***
*** ***
****************************************************************************/
/*****
*** This module reports all results.
*****/
#include "stdio.h"
#include "math.h"
#include "limits.h"
#include <dos.h>
#include "spmac.h"
#include "spref.h"
extern FILE *pf;
/*****
*** R e p o r t G l o b a l
*****/
void report_global()
{
iam(90);
block(in,"report",0.0);
fprintf(pf,"+++++++++++++++++++++++++++++++++++++++++++++++++\n");
fprintf(pf,"+ Core Values:\n");
fprintf(pf,"+ Temp = %g\n",coretemp);
fprintf(pf,"+ Press = %g\n",corepress);
fprintf(pf,"+ Dens = %g\n",coredensity);
fprintf(pf,"+ Energy = %g\n",eval_energy_rate(coredensity,coretemp));
fprintf(pf,"+ Opacity= %g\n",eval_opacity(corepress,coretemp));
fprintf(pf,"+ Global Values:\n");
fprintf(pf,"+ MeanMolWeight = %g\n",u);
fprintf(pf,"+ X=%g Y=%g Z=%g\n",X,Y,Z);
fprintf(pf,"+ Surface Temp = %g\n",efftemp);
fprintf(pf,"+ Mass Ratio = %g (%g)\n",massratio,(massratio*SM));
fprintf(pf,"+ Lum Ratio = %g (%g)\n",lumratio,(lumratio*SL));
fprintf(pf,"+ Radius Ratio = %g (%g)\n",radratio,(radratio*SR));
fprintf(pf,"+++++++++++++++++++++++++++++++++++++++++++++++++\n");
block(out,"report",0.0);
}
/*****
*** R e p o r t D e t a i l
*****/
void report_detail()
{
iam(91);
block(in,"detail",0.0);
fprintf(pf,"+++++++++++++++++++++++++++++++++++++++++++++++++\n");
fprintf(pf,"+ Current Values at MassFraction of %g\n",(m/mass));
fprintf(pf,"+ Temp = %g\n",temp);
fprintf(pf,"+ Press = %g\n",pressure);
fprintf(pf,"+ Density = %g\n",density);
fprintf(pf,"+ Mass = %g\n",m);
fprintf(pf,"+ Lum = %g\n",lum);
fprintf(pf,"+ Radius = %g\n",radius);
fprintf(pf,"+ Opacity = %g\n",opacity);
fprintf(pf,"+ Energy = %g\n",eval_energy_rate(density,temp));
fprintf(pf,"+++++++++++++++++++++++++++++++++++++++++++++++++\n");
block(out,"detail",0.0);
}
/*****
*** R e p o r t R e s u l t s
*****/
void report_results()
{
iam(92);
int i;
block(in,"results",0.0);
fprintf(pf,"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\n");
fprintf(pf,"R I N T E G R A T I O N R E S U L T S \n");
fprintf(pf,"R\n");
fprintf(pf,"R i Pressure Temperature Luminosity Radius\n");
fprintf(pf,"R - -------- ----------- ---------- ------\n");
fprintf(pf,"R\n");
for (i=0;i<6;i++)
fprintf(pf,"R %1d %g %g %g %g\n",i,
results[0][i],results[1][i],results[2][i],results[3][i]);
fprintf(pf,"R\n");
fprintf(pf,"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\n");
block(out,"results",0.0);
}
/*****
*** D u m p D a t a
*****/
char name[30];
void dump_data(tries)
int tries;
{
iam(93);
int i;
FILE *f;
block(in,"dumpdata",0.0);
sprintf(name,"spdata%d",tries);
f = fopen(name,"w");
fprintf(f,"%d\n",gradsteps);
for (i=0;i<gradsteps;i++)
fprintf(f,"%g %g %g %g %g %g %g %g\n",tmassgrad[i],pressgrad[i],tempgrad[i],
lumgrad[i],radiusgrad[i],densgrad[i],opctygrad[i],energygrad[i]);
fclose(f);
block(out,"dumpdata",0.0);
}